    <div id="breadcrumbs"><?php echo $this->Html->link('Home', array('controller' => 'contents', 'action' => 'view', 'home')); ?> > Email Subscribers
  </div>
<?php
echo $this->Form->create('newsletters', array('enctype' => 'multipart/form-data'));
?>
<div class="email">
<h2><?php echo __('Email Subscribers', array('controller'=>'Subscribers', 'action'=>'index')); ?></h2>
</div>

  <!-- Button trigger modal -->
  <a data-toggle="modal" href="#myModal" class="btn btn-primary btn-lg">List of Emails</a>

  <!-- Modal -->
  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title">Emails</h4>
        </div>
        <div class="modal-body">
          <?php
$CCount = 0;
echo "<table border='0' width='90%'>";

    foreach ($subscribers as $subscriber)
{
if($CCount % 2 == 0)
{
?>
         <tr>
<?php
}
?>
<td class="data" width="35%">

<?php echo $subscriber['Subscriber']["sub_email"];?>
</td>
<td class="data" align="center" width="15%">
<?php
$id = $subscriber['Subscriber']['sub_id'];

if($subscriber['Subscriber']['sub_active'] ==1){
    echo $this->Form->input("Email.checkbox.$id", array(
        'label'=>'',
        'legend'=>false,
        'type'=>'checkbox',
        'checked'=>'checked',
    ));
}else {
    echo $this->Form->input("Email.checkbox.$id", array(
        'label'=>'',
        'legend'=>false,
        'type'=>'checkbox',
    ));
}
?>
</td>
<?php
$CCount++;
}
?>
        </tr>
</table>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-primary" data-dismiss="modal">Save Changes</button>
<!--          <button type="button" class="btn btn-primary">Save changes</button>-->
        </div>
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->


<br /><br />

<table border="0" width="90%">
    <tr>
        <td style="border: none:">
            <?php echo $this->Form->input('subject', array('size'=>'80'));?>
        </td>
    </tr>
    <tr>
        <td style="border: none:">
            <?php echo $this->Form->input('message', array('rows' => '15', 'cols' => '95', 'value'=> 'This is the template mail for the newsletter for DCAB 2013, type to edit, or send as default'));?>
            <!-- this shows the main data in the email-->
        </td>
    </tr>
    <tr>
        <td >
            <?php echo $this->Form->file('submittedfile'); ?>

        </td>
    </tr>
    <tr>

    <td>
        <?php echo $this->Form->submit(__('Send Email', true), array('name' => 'Send Email')); ?></td>

    </tr>
</table>


